//
//  EFOrderProductItem.m
//  EnjogFood
//
//  Created by 王芳 on 17/5/16.
//  Copyright © 2017年 wf. All rights reserved.
//

#import "EFOrderProductItem.h"
#import "EFOrderProductCell.h"

@implementation EFOrderProductItem

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.viewClass = [EFOrderProductCell class];
        self.viewHeight = 114;
    }
    return self;
}

-(instancetype)initWithSpecialItem:(EFSepecialItem *)specialItem{
    self = [self init];
    if(self){
        self.product_name = specialItem.productName;
        self.price = specialItem.salePrice;
        self.qty = specialItem.qty.stringValue;
        self.img = specialItem.img;
        self.model_name = specialItem.model_name;
        if (specialItem.id != nil) {
            self.id = [NSString stringWithFormat:@"%@",specialItem.id];
        }else{
            self.id = specialItem.id;
        }
       
    }
    return self;
}

-(instancetype)initWithShoppingCartItem:(EFShoppingCartItem *)shoppingCartItem{
    self = [self init];
    if(self){
        self.product_name = shoppingCartItem.productName;
        self.price = shoppingCartItem.salePrice;
        self.qty = shoppingCartItem.qty.stringValue;
        self.img = shoppingCartItem.img;
        self.id = shoppingCartItem.id;
    }
    return self;
}

@end
